<%-- 
    Document   : rss
    Created on : 30-may-2009, 10:48:15
    Author     : thanent
--%>

<%@page contentType="text/xml" pageEncoding="UTF-8" import="Funcionalidad.*,java.net.*,java.util.*"%>

<rss version="2.0">
    <channel>
        <title>FLOG</title>
        <link>../web</link>
        <language>es-CL</language>
        <description>FLOG - Estilo de vida</description>
        <generator>FLOG</generator>

        <%
        String desc;
        URLDecoder deco = new URLDecoder();
        List<Post> post = new ArrayList();
        try {
            post = Posts.consultaPosts();
        } catch (Exception ex) {
            out.print(ex.getMessage());
        }
//recorremos la lista de post y mostramos solo los 10 primeros en el rss
        Iterator it = post.iterator();
        int cont = 0;
        while (it.hasNext() && cont < 10) {
            Post pos = (Post) it.next();
            desc=deco.decode(pos.getTexto(), "ISO-8859-1").substring(40);
        %>
        <item>
            <title><%= deco.decode(pos.getTitulo(), "ISO-8859-1")%></title>
            <link>http://localhost:8084/FLOG_jsp/Apariencia/VistaNuevoComentario.jsp?id=<%=pos.getId_post()%></link>
            <comments>http://localhost:8084/FLOG_jsp/Apariencia/VistaNuevoComentario.jsp?id=<%=pos.getId_post()%></comments>
            <pubDate><%=pos.getFecha()%></pubDate>
            <guid>http://localhost:8084/FLOG_jsp/Apariencia/VistaNuevoComentario.jsp?id=<%=pos.getId_post()%></guid>
        </item>
        <%
            cont++;
        }
        %>

</channel></rss>

